export const createComment =(vm) =>{
  let data = {
   commodityId: vm.categoryId,
   content: vm.commentForm.content,
   createTime: null,
   name: vm.$store.state.userInfo.username,
   star: vm.rate
  }
  vm.$axios.post('/comment/create',data)
    .then((res)=>{
      vm.$message.success('发布成功')
      getComment(vm)
    })
}
export const getComment =(vm) =>{
  let data = {
    commodityId: vm.categoryId,
  }
  vm.$axios.get('/comment/select/commodityId',{params: data})
    .then((res)=>{
      console.log(res)
      vm.commentList = res.data.data
      vm.listFlag = res.data.data.length
    })
}
